<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('contents'); ?>
<script language="javascript">
$(function(){
	$('#form_banner').submit(function(){
		if($.trim($('#title').val()) == ''){
			alert('请输入名称！');
			$('#title').focus();
			return false;	
		}
		if($.trim($('#the_url').val()) == ''){
			alert('请输入地址！');
			$('#the_url').focus();
			return false;	
		}
		if(confirm('您确定要提交吗？')){
			return true;	
		}else{
			return false;
		}
	});	
});
</script>
<?php echo $alert;?>
<style>
/*打印表格*/
.print_table {
	border-collapse:collapse;/*border:1px solid #000000;*/
}
.print_table th {
	border:1px solid #CCCCCC;
}
.print_table td {
	border:1px solid #CCCCCC;
}
</style>
<form class="fsimple" id="form_banner" name="form_banner" action="" method="post" enctype="multipart/form-data" >
  <fieldset class="query_form" style="margin-top:10px;">
    <legend>添加广告</legend>
    <table width="1000">
      <tr height="30">
        <td width="146" >名称：</td>
        <td width="842" ><input name="title" type="text"  id="title" value="" size="50" /><font class="req">*</font></td>
      </tr>
      <tr height="30">
        <td width="146" >类型：</td>
        <td width="842" >
        	<select name="type_id">
            <?php
            	foreach($banner_type as $k => $v){
					echo '<option value="'.$k.'">'.$v.'</option>';	
				}
			?>
            </select><font class="req">*</font></td>
      </tr>
      <tr height="30">
        <td width="146" >地址：</td>
        <td width="842" ><input name="the_url" type="text"  id="the_url" value="" size="50" /><font class="req">*</font></td>
      </tr>
      <tr height="30">
        <td >图片：</td>
        <td ><input type="file" name="pic" id="pic" /><span class="error"><?php echo $error_pic_msg;?></span></td>
      </tr>
    </table>
  </fieldset>
  <table width="900">
    <tr align="center" height="30">
      <td ><input name="按钮" type="submit" class="btn" style="margin-left: 14px;" value="提交">
        &nbsp;&nbsp;
        <input type="button" class="btn" value="返回" onclick="javascript:location='<?php echo url('banner')?>';"></td>
    </tr>
  </table>
</form>
<?php $this->_endblock(); ?>
